// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 创建点位配置 -- 虚拟点 POST /api/virtualPoint/create */
export async function postApiVirtualPointCreate(
  params: {
    // query
    /** 串口配置详情ID */
    deviceDetailId: string;
  },
  body: {
    /** 名称：数据点值上限
说明：数据点大于上限值将会被过滤掉不会进入下一步处理逻辑；
获取不到该字段的配置时不进行本侧校验。 */
    valueCeiling?: number;
    /** 名称：数据点值下限
说明：数据点小于下限值将会被过滤掉不会进入下一步处理逻辑；
获取不到该字段的配置时不进行本侧校验。 */
    valueFloor?: number;
    /** 采集类型-0累积量，1瞬时量 */
    acquisitionType?: 'MOMENTARY' | 'ACCUMULATION';
    /** 名称：报警公式原始值
说明：用于页面展示 */
    rawFormula?: string;
  },
  options?: { [key: string]: any },
) {
  return request<{
    id?: number;
    deviceDetailId?: number;
    driveType?:
      | 'MOD_BUS_RTU'
      | 'MOD_BUS_TCP'
      | 'MOD_BUS_RTU_OVER_TCP'
      | 'DLT645_1997'
      | 'DLT645_2007'
      | 'DATABASE'
      | 'HOST_LINK'
      | 'FINS_COM';
    valueCeiling?: number;
    valueFloor?: number;
    acquisitionType?: 'MOMENTARY' | 'ACCUMULATION';
    rawFormula?: string;
    relatedIds?: number[];
  }>('/api/virtualPoint/create', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除一个点位配置 -- 虚拟点 DELETE /api/virtualPoint/remove/${param1} */
export async function deleteApiVirtualPointRemove_id_D(
  params: {
    // path
    /** 虚拟点ID */
    id: string;
    'id:/d/': string;
  },
  options?: { [key: string]: any },
) {
  const { id: param0, 'id:/d/': param1, ...queryParams } = params;
  return request<Record<string, any>>(`/api/virtualPoint/remove/${param1}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 查找一个点位配置 -- 虚拟点 GET /api/virtualPoint/queryOne/${param1} */
export async function getApiVirtualPointQueryOne_id_D(
  params: {
    // path
    /** 虚拟点ID */
    id: string;
    'id:/d/': string;
  },
  options?: { [key: string]: any },
) {
  const { id: param0, 'id:/d/': param1, ...queryParams } = params;
  return request<{
    id?: number;
    deviceDetailId?: number;
    driveType?:
      | 'MOD_BUS_RTU'
      | 'MOD_BUS_TCP'
      | 'MOD_BUS_RTU_OVER_TCP'
      | 'DLT645_1997'
      | 'DLT645_2007'
      | 'DATABASE'
      | 'HOST_LINK'
      | 'FINS_COM';
    valueCeiling?: number;
    valueFloor?: number;
    acquisitionType?: 'MOMENTARY' | 'ACCUMULATION';
    rawFormula?: string;
    relatedIds?: number[];
  }>(`/api/virtualPoint/queryOne/${param1}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 查找串口配置详情下的所有虚拟点配置 GET /api/virtualPoint/queryByDeviceDetail/${param1} */
export async function getApiVirtualPointQueryByDeviceDetail_id_D(
  params: {
    // path
    /** 串口配置详情ID */
    id: string;
    'id:/d/': string;
  },
  options?: { [key: string]: any },
) {
  const { id: param0, 'id:/d/': param1, ...queryParams } = params;
  return request<
    {
      id?: number;
      deviceDetailId?: number;
      driveType?:
        | 'MOD_BUS_RTU'
        | 'MOD_BUS_TCP'
        | 'MOD_BUS_RTU_OVER_TCP'
        | 'DLT645_1997'
        | 'DLT645_2007'
        | 'DATABASE'
        | 'HOST_LINK'
        | 'FINS_COM';
      valueCeiling?: number;
      valueFloor?: number;
      acquisitionType?: 'MOMENTARY' | 'ACCUMULATION';
      rawFormula?: string;
      relatedIds?: number[];
    }[]
  >(`/api/virtualPoint/queryByDeviceDetail/${param1}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 编辑点位配置 -- 虚拟点 PUT /api/virtualPoint/update/${param1} */
export async function putApiVirtualPointUpdate_id_D(
  params: {
    // path
    /** 虚拟点ID */
    id: string;
    'id:/d/': string;
  },
  body: {
    /** 名称：数据点值上限
说明：数据点大于上限值将会被过滤掉不会进入下一步处理逻辑；
获取不到该字段的配置时不进行本侧校验。 */
    valueCeiling?: number;
    /** 名称：数据点值下限
说明：数据点小于下限值将会被过滤掉不会进入下一步处理逻辑；
获取不到该字段的配置时不进行本侧校验。 */
    valueFloor?: number;
    /** 采集类型-0累积量，1瞬时量 */
    acquisitionType?: 'MOMENTARY' | 'ACCUMULATION';
    /** 名称：报警公式原始值
说明：用于页面展示 */
    rawFormula?: string;
  },
  options?: { [key: string]: any },
) {
  const { id: param0, 'id:/d/': param1, ...queryParams } = params;
  return request<{
    id?: number;
    deviceDetailId?: number;
    driveType?:
      | 'MOD_BUS_RTU'
      | 'MOD_BUS_TCP'
      | 'MOD_BUS_RTU_OVER_TCP'
      | 'DLT645_1997'
      | 'DLT645_2007'
      | 'DATABASE'
      | 'HOST_LINK'
      | 'FINS_COM';
    valueCeiling?: number;
    valueFloor?: number;
    acquisitionType?: 'MOMENTARY' | 'ACCUMULATION';
    rawFormula?: string;
    relatedIds?: number[];
  }>(`/api/virtualPoint/update/${param1}`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}
